﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

using Think.Lenovo.Com.Common;
using Think.Lenovo.Com.DataAccess.Questionnaire;

namespace Think.Lenovo.Com.qiantai
{
    public partial class diaocha : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            #region //1.判断用户是否登录

            #endregion
            #region//2.列表
            #region//2.1 得到参数
            int pageIndex = 1;
            int pageSize = 3;
            if (!Int32.TryParse(Request["pageIndex"], out pageIndex))
            {
                pageIndex = 1;
            }
            #endregion
            #region//2.2得到数据列表
            DiaoChaWenJuan dcwj = new DiaoChaWenJuan();
            DataSet ds = dcwj.GetDiaoChaWenJuan(pageIndex, pageSize, null, "Survey_creatDate desc");
            this.List.DataSource = ds;
            this.List.DataBind();
            #endregion
            #region//2.3得到分页页码
            int recordCount = dcwj.GetDiaoChaWenJuanCount(null);
            LinkedList<PageNumberModel> pager = PageBuilder.LinkedPage(recordCount, pageSize, pageIndex, 10, "diaocha.aspx?pageIndex={pageIndex}", "{pageIndex}");
            this.Pager.DataSource = pager;
            this.Pager.DataBind();
            #endregion
            #endregion
        }
    }
}